<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <title>呼叫中心运营平台</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/non-responsive.css">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap-theme.css">
    <link rel="stylesheet" type="text/css" href="/css/global.css">
    <link rel="stylesheet" type="text/css" href="/css/company.css">
  </head>
  <body>
    <nav class="navbar navbar-inverse navbar-static-top">
      <div class="container">
        <div class="navbar-header">
          <a class="navbar-brand" href="#"><img alt="Logo" src="/img/logo.png"></a>
          <a class="navbar-brand" href="#">运营平台</a>
        </div>
        <div id="navbar">
          <ul class="nav navbar-nav">
            <li class="active"><a href="/company">企业管理</a></li>
            <li><a href="/task">任务监控</a></li>
            <li><a href="/user">账户管理</a></li>
            <li><a href="/agent">座席管理</a></li>
            <li><a href="/sound">语音管理</a></li>
            <li><a href="/service">服务管理</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                <span class="glyphicon glyphicon-cog" aria-hidden="true"></span> 系统管理
              </a>
              <ul class="dropdown-menu">
                <li><a href="/gateway">中继网关</a></li>
                <li><a href="/status">服务器状态</a></li>
                <li><a href="/logs">日志记录</a></li>
              </ul>
            </li>
          </ul>
          <ul class="nav navbar-nav navbar-right">
            <li><a><img class="img-circle icon" src="/img/<?php echo $user->icon; ?>.png" width="19" height="19"> <?php echo $user->name; ?></a></li>
            <li><a href="/logout"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> 退 出</a></li>
          </ul>
        </div>
      </div>
    </nav>
    <div class="container box">
      <div>
        <ol class="breadcrumb">
          <li>当前位置:</li>
          <li>企业管理</li>
          <li class="active">所有企业</li>
          <li class="pull-right" style="color:#555555"><a class="btn btn-info btn-xs" href="/company/create"><span class="glyphicon glyphicon-plus"></span> 创建企业</a></li>
        </ol>
      </div>
      <div>
        <table class="table table-condensed table-striped table-hover">
          <thead>
            <tr>
              <th>#</th>
              <th>企业编号</th>
              <th>公司名称</th>
              <th>VIP级别</th>
              <th>座席数量</th>
              <th>最大并发数</th>
              <th>创建时间</th>
              <th class="td-edit">删除操作</th>
              <th class="td-edit">编辑操作</th>
            </tr>
          </thead>
          <tbody class="text-muted">
            <?php
            if (is_array($companys) && count($companys > 0)) {
              foreach ($companys as $company) {
                echo '<tr>',"\n";
                echo '<td><span class="glyphicon glyphicon-globe"></span></td>',"\n";
                echo '<td>',$company['id'],'</td>',"\n";
                echo '<td><a href="/company/attack/',$company['id'],'" target="_blank">',$company['name'],'</a></td>',"\n";
                echo '<td><img src="/img/level_',$company['level'],'.gif"></td>',"\n";
                echo '<td>',$company['agent'],'</td>',"\n";
                echo '<td>',$company['concurrent'],'</td>',"\n";
                echo '<td>',$company['create_time'],'</td>',"\n";
                echo '<td><a class="btn btn-default btn-xs" href="javascript:;" onClick="deleteCompany(',$company['id'],')"><span class="glyphicon glyphicon-trash"></span> 删 除</a></td>',"\n";
                echo '<td><a class="btn btn-default btn-xs" href="/company/edit/',$company['id'],'"><span class="glyphicon glyphicon-edit"></span> 编 辑</a></td>',"\n";
                echo '</tr>',"\n";
              }
            }
            ?>
          </tbody>
        </table>
      </div>
    </div>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/js/layer.js"></script>
    <script type="text/javascript" src="/js/company.js"></script>
    <script type="text/javascript">
      $('li.dropdown').mouseover(function() {   
        $(this).addClass('open');
      }).mouseout(function() {
        $(this).removeClass('open');
      });
    </script>
  </body>
</html>
